<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>obfuscator_lite</title>

    <script src="https://cdn.jsdelivr.net/npm/javascript-obfuscator/dist/index.browser.js"></script>

</head>

<body>

<label for="options">options</label>
<textarea id="options" rows="15" cols="50">
{
    "identifierNamesGenerator": "hexadecimal",
    "renameGlobals": true,
    "selfDefending": true,
    "deadCodeInjection": true,
    "disableConsoleOutput": true,
    "reservedNames": [
        "tdrpa_tdChrome_findElement",
		"tdrpa_tdChrome_generateGUID"
    ],
    "seed": 0
}
</textarea>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<label for="input">input</label>
<textarea id="input" rows="15" cols="50">
a=1
</textarea>

<br><br><br>

<label for="output">output</label>
<textarea id="output" rows="15" cols="50" readonly>
</textarea>

<button id="btnDo">do</button>
<button id="btnCopy">copy</button>


</body>
</html>


<script>
    document.getElementById('btnDo').addEventListener('click', function()
    {
        try
        {
            options=document.getElementById('options').value
            input=document.getElementById('input').value
            obfuscationResult = JavaScriptObfuscator.obfuscate(input,JSON.parse(options));
            document.getElementById('output').value=obfuscationResult.getObfuscatedCode()
        }
        catch(error)
        {
            document.getElementById('output').value=error.message
        }
    });

    document.getElementById('btnCopy').addEventListener('click', function() 
    {
        output=document.getElementById('output').value
        navigator.clipboard.writeText(output)
    });

</script>

